{
StBoxLayoutPrivate *priv = self->priv;
gint n_children = 0;
+ gint n_fixed = 0;
gfloat min_width, natural_width;
GList *l;
n_children++;
+ if (clutter_actor_get_fixed_position_set (child))
+ {
+ n_fixed++;
+ continue;
+ }
+
clutter_actor_get_preferred_width (child,
(!priv->is_vertical) ? for_height : -1,
&child_min,
}
}
- if (!priv->is_vertical && n_children > 1)
+ if (!priv->is_vertical && (n_children - n_fixed) > 1)
{
- min_width += priv->spacing * (n_children - 1);
- natural_width += priv->spacing * (n_children - 1);
+ min_width += priv->spacing * (n_children - n_fixed - 1);
+ natural_width += priv->spacing * (n_children - n_fixed - 1);
}
if (min_width_p)
{
StBoxLayoutPrivate *priv = self->priv;
gint n_children = 0;
+ gint n_fixed = 0;
gfloat min_height, natural_height;
GList *l;
n_children++;
+ if (clutter_actor_get_fixed_position_set (child))
+ {
+ n_fixed++;
+ continue;
+ }
+
clutter_actor_get_preferred_height (child,
(priv->is_vertical) ? for_width : -1,
&child_min,
}
}
- if (priv->is_vertical && n_children > 1)
+ if (priv->is_vertical && (n_children - n_fixed) > 1)
{
- min_height += priv->spacing * (n_children - 1);
- natural_height += priv->spacing * (n_children - 1);
+ min_height += priv->spacing * (n_children - n_fixed - 1);
+ natural_height += priv->spacing * (n_children - n_fixed - 1);
}
if (min_height_p)
*/
/* Find the amount of possible shrink for each child */
- int n_visible_children = 0;
+ int n_possible_shrink_children = 0;
for (l = priv->children, i = 0; l; l = l->next, i++)
{
ClutterActor *child = l->data;
gfloat child_min, child_nat;
+ gboolean fixed;
+
+ child = (ClutterActor*) l->data;
+ fixed = clutter_actor_get_fixed_position_set (child);
shrinks[i].child_index = i;
- if (CLUTTER_ACTOR_IS_VISIBLE (child))
+ if (CLUTTER_ACTOR_IS_VISIBLE (child) && !fixed)
{
if (priv->is_vertical)
clutter_actor_get_preferred_height (child,
&child_min, &child_nat);
shrinks[i].shrink_amount = MAX (0., child_nat - child_min);
- n_visible_children++;
+ n_possible_shrink_children++;
}
else
{
/* Start by moving the line downward, top-of-bar by top-of-bar */
shrink_so_far = 0;
- for (n_shrink_children = 1; n_shrink_children <= n_visible_children; n_shrink_children++)
+ for (n_shrink_children = 1; n_shrink_children <= n_possible_shrink_children; n_shrink_children++)
{
- if (n_shrink_children < n_visible_children)
+ if (n_shrink_children < n_possible_shrink_children)
base_shrink = shrinks[n_shrink_children].shrink_amount;
else
base_shrink = 0;
shrink_so_far += n_shrink_children * (shrinks[n_shrink_children - 1].shrink_amount - base_shrink);
- if (shrink_so_far >= total_shrink || n_shrink_children == n_visible_children)
+ if (shrink_so_far >= total_shrink || n_shrink_children == n_possible_shrink_children)
break;
}
ClutterActor *child = l->data;
gboolean expand;
- if (!CLUTTER_ACTOR_IS_VISIBLE (child))
+ if (!CLUTTER_ACTOR_IS_VISIBLE (child) ||
+ clutter_actor_get_fixed_position_set (child))
continue;
clutter_container_child_get ((ClutterContainer *) actor,
ClutterActor *child = (ClutterActor*) l->data;
ClutterActorBox child_box;
gfloat child_min, child_nat, child_allocated;
- gboolean xfill, yfill, expand;
+ gboolean xfill, yfill, expand, fixed;
StAlign xalign, yalign;
if (!CLUTTER_ACTOR_IS_VISIBLE (child))
goto next_child;
+ fixed = clutter_actor_get_fixed_position_set (child);
+ if (fixed)
+ {
+ clutter_actor_allocate_preferred_size (child, flags);
+ goto next_child;
+ }
+
clutter_container_child_get ((ClutterContainer*) actor, child,
"x-fill", &xfill,
"y-fill", &yfill,